import request from '@/utils/request'
import qs from 'qs'

// 新增
export const addArticle = data => {
  return request({
    url: '/wz/save',
    method: 'POST',
    data
  })
}

// 查询文章 /wz/query
export const queryArticle = params => {
  return request({
    url: '/wz/query',
    method: 'GET',
    params
  })
}

// /wz/delete 根据文章id审核文章
export const deleteArticle = data => {
  return request({
    url: '/wz/delete?' + qs.stringify(data),
    method: 'POST'
  })
}

// 修改文章 /wz/update
export const updateArticle = data => {
  return request({
    url: '/wz/update',
    method: 'POST',
    data
  })
}

// /wz/isHot 是否热门
export const isHot = data => {
  return request({
    url: '/wz/isHot?' + qs.stringify(data),
    method: 'POST'
  })
}

// /wz/audit 是否热门
export const auditArticle = data => {
  return request({
    url: '/wz/audit',
    method: 'POST',
    data
  })
}
// 导出 /wzExprot/exportWz
export const exportWz = params => {
  return request({
    url: '/wzExprot/exportWz',
    method: 'GET',
    params,
    responseType: 'blob'
  })
}
